package cn.dada.dadarecipes.base.config;

//import cn.dada.dadarecipes.base.interceptor.MerchantLoginCheckInterceptor;
//import cn.dada.dadarecipes.base.interceptor.UserLoginCheckInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.ArrayList;
import java.util.List;

@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
    static List<String> users = new ArrayList<>();
    static List<String> merchants = new ArrayList<>();

    static {
        users.add("/v1/user/logout");

        merchants.add("/v1/merchant/logout");
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        /* 普通用户登录拦截校验 */
//        registry.addInterceptor(new UserLoginCheckInterceptor())
//                .addPathPatterns(users);
        /* 商家登录拦截校验 */
//        registry.addInterceptor(new MerchantLoginCheckInterceptor())
//                .addPathPatterns(merchants);
    }
}
